import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { ConfigProviderTheme } from 'vant'

const useAppStore = defineStore('app', {
  state:()=>({
    theme: ref<ConfigProviderTheme>('light')
  }),
  getters: {
    getTheme: (state) => state.theme
  },
  actions: {
    setTheme(val: ConfigProviderTheme) {
      this.theme = val
    }
  },
  persist: true
})

export default useAppStore
